/*
 * SiFiSy - A File System Simulator
 * Copyright (C) 2010  SevenSoft
 *
 * This file is part of SiFiSy.
 *
 * SiFiSy is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * SiFiSy is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with SiFiSy.  If not, see <http://www.gnu.org/licenses/>.
 *
 *SevenSoft - Progetto "SiFiSy"
 *NOME FILE: File.java
 *AUTORE: Alessandro Vedovato
 *DATA CREAZIONE: 18/02/2010
 *REGISTRO DELLE MODIFICHE:
 *21/02/2010 Inseriti i JavaDoc per tutti i metodi
 *20/02/2010 Aggiunti tutti i get and set
 *18/02/2010 Prima implementazione della classe inizializazione dei campi dati e
 *metodi vuoti
 */

package sifisy.core;

public class File {
    private String id = "0";
    private int dimension = 0;
    private int exponent = 0;
    private long averageBlocks = 0;
    private boolean selectedAdvanced = false;

    /**
     * return true if user sets advanced option
     * @return a boolean values
     */
    public boolean getSelectedAdvanced() {
        return selectedAdvanced;
    }

    /**
     * Sets variable keep saved if user sets advanced option
     * @param selectedAdvanced
     */
    public void setSelectedAdvanced(boolean selectedAdvanced) {
        this.selectedAdvanced = selectedAdvanced;
    }

        /**
     * Method that return averageBlocks field
     * @return
     */
    /**
     * returns value of contiguos average blocks
     * @return a value of variable average blocks
     */
    public long getAverageBlocks() {
        return averageBlocks;
    }

    /**
     * Sets value of contiguos average blocks
     * @param averageBlocks
     */
    public void setAverageBlocks(long averageBlocks) {
        this.averageBlocks = averageBlocks;
    }

    /**
     * return the id of selected file
     * @return a String
     */
    public String getId() {
        return id;
    }

    /**
     * sets the id of selected file
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * returns dimension of file
     * @return
     */
    public int getDimension() {
        return dimension;
    }

    /**
     * sets dimension of file
     * @param dimension
     */
    public void setDimension(int dimension) {
        this.dimension = dimension;
    }

    /**
     * return exponent of dimension
     * @return exponent
     */
    public int getExponent() {
        return exponent;
    }

    /**
     * sets exponent of dimension
     * @param exponent
     */
    public void setExponent(int exponent) {
        this.exponent = exponent;
    }

    /**
     * return size of file calculate with dimension and exponent values
     * @return
     */
    public long getSize() {
        return (long)(dimension*Math.pow(2, exponent));
    }
}
